import { Arrow } from "../svg/svg";
import "./pageChange.scss";

type PageChangeProps = Omit<
  React.HTMLAttributes<HTMLDivElement>,
  "children"
> & {
  onPrev?: () => void;
  onNext?: () => void;
  totalPage?: number;
  nowPage: number;
  type: boolean;
};

export const PageChange = ({
  onPrev,
  onNext,
  // totalPage,
  nowPage,
  type,
}: PageChangeProps) => {
  const handlePrev = () => {
    onPrev?.();
  };

  const handleNext = () => {
    onNext?.();
  };

  return (
    <>
      {type ? (
        <></>
      ) : (
        <div className="dashboard_page_change_box show_one">
          <div className="dashboard_prev_button" onClick={handlePrev}>
            <Arrow />
          </div>
          <div className="dashboard_page_box">{nowPage} </div>
          <div className="dashboard_next_button" onClick={handleNext}>
            <Arrow />
          </div>
        </div>
      )}
    </>
  );
};
